package com.designpatterns.mediator.concretemediator;

import com.designpatterns.mediator.colleague.Colleague;
import com.designpatterns.mediator.colleagueclass.ColleagueA;
import com.designpatterns.mediator.colleagueclass.ColleagueB;
import com.designpatterns.mediator.mediator.Mediator;

/**
 * ConcreateMediator Class
 *
 * @author Haiqi.Wang
 * @since 2013-6-9下午4:51:33
 */
public class ConcreteMediator extends Mediator {

	private Colleague ca;
	private Colleague cb;
	
	public ConcreteMediator() {
		ca = new ColleagueA();
		cb = new ColleagueB();
	}
	
	@Override
	public void notice(String content) {
		if (content.equals("boss")) {
			//老板来了，通知员工A
			ca.action();
		}
		if (content.equals("client")) {
			//客户来了，通知前台B
			cb.action();
		}
	}

}
